#include "testcase_utils.h"
#include <stdlib.h>

void ClearHcclEnv()
{
    unsetenv("HCCL_HIGH_PERF_ENABLE");
    unsetenv("HCCL_DETERMINISTIC");
    unsetenv("HCCL_INTRA_PCIE_ENABLE");
    unsetenv("HCCL_INTRA_ROCE_ENABLE");
    unsetenv("HCCL_ALGO");
    unsetenv("HCCL_BUFFSIZE");
    unsetenv("HCCL_INTER_HCCS_DISABLE");
    unsetenv("HCCL_OP_EXPANSION_MODE");
    unsetenv("HCCL_CONCURRENT_ENABLE");
    unsetenv("HCCL_DEBUG_CONFIG");
    return;
}

std::vector<u64> GenerateSendCountMatrix(u64 count, u32 rankSize)
{
    std::vector<u64> sendCountMatrix(rankSize * rankSize, count);
    return sendCountMatrix;
}

void GenAllToAllVParams(u32 rankSize, u64 count, std::vector<u64>& sendCounts, std::vector<u64>& sdispls,
                        std::vector<u64>& recvCounts, std::vector<u64>& rdispls)
{
    u64 sendDisplacement = 0;
    u64 recvDisplacement = 0;
    for (u32 i = 0; i < rankSize; i++) {
        sendCounts.push_back(count);
        sdispls.push_back(sendDisplacement);
        recvCounts.push_back(count);
        rdispls.push_back(recvDisplacement);
        sendDisplacement += count;
        recvDisplacement += count;
    }
    return;
}